from django.db import models
from homes.models import Category
# Create your models here.
from utils.basemodel import BaseModel


class Goods(BaseModel):
    name = models.CharField(max_length=50, verbose_name='商品名称')
    price = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='商品价格')
    img = models.CharField(max_length=200, verbose_name='商品图片')
    desc = models.CharField(max_length=200, verbose_name='商品描述')
    category = models.ForeignKey(
        Category,
        verbose_name='商品分类',
        on_delete=models.CASCADE
    )

    class Meta:
        db_table = 'ks_goods'
        verbose_name = '商品'
